-
Notifications
You must be signed in to change notification settings - Fork 377
chore(lint): eslint react-table #3693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
PF3 preview: https://patternfly-react-pr-3693-pf3.surge.sh |
Codecov Report
@@ Coverage Diff @@
## master #3693 +/- ##
=========================================
Coverage ? 71.26%
=========================================
Files ? 779
Lines ? 10489
Branches ? 2261
=========================================
Hits ? 7475
Misses ? 2592
Partials ? 422
Continue to review full report at Codecov.
|
packages/patternfly-4/react-table/src/components/Table/SelectColumn.tsx
Outdated
Show resolved
Hide resolved
| rowKey = 'id' as string, | ||
| onRowClick = (event: React.MouseEvent, row: IRow, rowProps: IExtraRowData, computedData: IComputedData) => undefined as OnRowClick, | ||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
| onRow = (...args: any) => Object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onRow and onRowClick appear to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both onRow and onRowClick were throwing TS errors - it looks like the unused variable errors were for the arguments to both functions (...args for onRow, and event/row/rowProps/computedData for onRowClick)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we track down how onRow is used and give it a proper type?
Also, for the unused variables, just put underscores before the variable names. Like _event: React.MouseEvent. Then you can remove the eslint-disable.
| rowKey = 'id' as string, | ||
| onRowClick = (event: React.MouseEvent, row: IRow, rowProps: IExtraRowData, computedData: IComputedData) => undefined as OnRowClick, | ||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
| onRow = (...args: any) => Object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we track down how onRow is used and give it a proper type?
Also, for the unused variables, just put underscores before the variable names. Like _event: React.MouseEvent. Then you can remove the eslint-disable.
packages/patternfly-4/react-table/src/components/Table/Body.tsx
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/SelectColumn.tsx
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/base/columns-are-equal.ts
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/base/evaluate-formatters.ts
Outdated
Show resolved
Hide resolved
| class BaseBody extends React.Component<BodyProps, {}> { | ||
| static defaultProps = { | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| onRow: (...args: any) => Object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A proper type for onRow would be wonderful.
packages/patternfly-4/react-table/src/components/Table/base/evaluate-transforms.ts
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/base/resolve-row-key.ts
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/utils/decorators/headerCol.tsx
Outdated
Show resolved
Hide resolved
redallen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine that we can't solve the onRow prop for now. We can fix it in the future.
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
| } | ||
|
|
||
| export interface IHeaderRow extends ColumnType { } | ||
| export type IHeaderRow = ColumnType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have changed this from interface to type?
What: Towards #3592 - linting for react-table